export enum ChatType {
  friend = 1,
  group = 2,
  friendNotify = 3,
  heartBeat = 4,
}

// 区分消息类型
export enum MessageType {
  text = 0,
  image = 1,
  file = 2,
  mixTxtImg = 3,
  voiceCall = 4,
  videoCall = 5,
  requestAdd = 6,
  friendOnline = 7,
  friendOff = 8,
}

export enum MessageStatus {
  wait = 0,
  success = 1,
  error = 2,
  cancel = 3,
}

export enum CallStatus {
  none = 0,
  wait = 1,
  agree = 2,
  reject = 3,
  cancel = 4,
  end = 5,
  record = 6,
}

interface IMessage {
  uuid: string;
  sendId: number;
  toId: number;
  groupId?: number;
  sessionId: string;
  chatType: number;
  messageType: number;
  updatedAt: string;
  createdAt: string;
  quotationId?: string; //消息引用id
  aitIds?: string; // @ userId
  fileName?: string;
  fileUrl?: string;
  fileSize?: number;
  localPath?: string;
  content?: string;
  callStatus?: number;
  status: MessageStatus;
}

interface IMessagePageInfo {
  page: number;
  pageSize: number;
}

interface IGetChatMessageRes extends IMessagePageInfo {
  totalPage: number;
  data: IGetMessageRes[];
}

interface IGetMessageRes extends IMessage {
  ownerId: number;
}

interface IMessageFileRes {
  uuid: string;
  fileName: string;
  fileUrl: string;
  localPath: string;
  fileSize: number;
  updatedAt: string;
}

export type { IMessage, IMessagePageInfo, IGetChatMessageRes, IGetMessageRes, IMessageFileRes };
